package com.cff.util;

import java.io.UnsupportedEncodingException;

import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPException;

public class LdapUtil {
	private static String ldapHost = "144.131.252.69";
	private static int ldapPort = 389;
	private static String ldapBindDN = "cn=Manager,dc=visit,dc=chinaums";;
	private static String ldapPassword = "chinaums";
	private static int ldapVersion = LDAPConnection.LDAP_V3;
	
	@SuppressWarnings("deprecation")
	public static LDAPConnection connection() throws LDAPException, UnsupportedEncodingException
	{ 
		String modifyDn="cn=Staff,ou=People,dc=lisys,dc=cn";
		LDAPConnection lc = new LDAPConnection();
		lc.connect(ldapHost, ldapPort);
		lc.bind(ldapVersion, ldapBindDN, ldapPassword.getBytes("UTF8"));
		return lc;
    }
}
